import QtQuick
import QtQuick.Controls

Window {
    width: 640
    height: 480
    visible: true
    title: qsTr("Hello World")
    onClosing:{
        pHub.closeCam()
    }

    Image{
        id: img
        anchors.fill: parent
        anchors.rightMargin: parent.width*0.5

        Connections{
            id: con
            target: pImageViewer
            function onCallQmlRefreshImg(){
                img.source="image://live/"+Date.now()
            }
        }
    }
    Button{
        text: "打开相机"
        onClicked: {
            pHub.openCam()
        }
    }
    Image{
        id: img2
        anchors.fill: parent
        anchors.leftMargin: parent.width*0.5

        Connections{
            //target: pImageProcess
            target: pHub
            function onCallQmlRefreshImg(){
                img2.source="image://result/"+"1#"+Date.now()
            }
        }
    }
    Button{
        text: "处理图像"
        anchors.right: parent.right
        onClicked: {
            //pHub.processImg()
            pHub.startProcess()
        }
    }
}
